<template>
    <div>
        <hr>
        当前乘积为：<span>{{ $store.state.sum }}</span><br><br>

        <select v-model.number = 'n'>
            <option value="1">1</option>
            <option value="2">2</option>
            <option value="3">3</option>
        </select>
        <button @click="Cheng(n)">*</button>
    </div>
</template>

<script>
export default {
    name: 'Cheng',
    data(){
        return {
            n:1
        }
    },
    methods:{
        Cheng(){
            this.$store.commit('Cheng',this.n)
        }
    },
    computed:{
    }
};
</script>

<style>
    button{
        margin-left:10px;
    }
</style>